<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="s"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ page session="false"%>
<%@ page pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <title>添加/修改分类</title>
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
        
        <link href="<c:url value="/resources/messages/messages.css" />" rel="stylesheet" type="text/css" />
        <link href="<c:url value="/resources/css/style.css" />" rel="stylesheet" type="text/css" />
        <link href="<c:url value="/resources/jqueryui/1.8/themes/ui-lightness/jquery-ui-1.8.16.custom.css" />" rel="stylesheet" type="text/css" />

        <script src="<c:url value="/resources/jquery/jquery.js" />"></script>
        <script src="<c:url value="/resources/jqueryui/1.8/jquery-ui-1.8.16.custom.min.js" />"></script>
        <script src="<c:url value="/resources/jqueryui/1.8/jquery.ui.datepicker-zh-CN.js" />"></script>
        <script src="<c:url value="/resources/jquery/plugin/cookie/jquery.cookie.js" />"></script>
        <script src="<c:url value="/resources/scripts/html5.js" />"></script>
        
        <style>

        </style>
    </head>
    <body>
        <form:form id="form" method="post" modelAttribute="category" cssClass="cleanform">
        <div class="header">
            <c:if test="${not empty message}">
                <div id="message" class="success">
                    ${message}
                </div>
            </c:if>
        </div>
        <table class="table-list-style">
            <caption>添加/修改分类</caption>
            <tbody>
                <form:hidden path="id" />
                <form:hidden path="parentId" />
                <tr>
                    <td>名称:</td>
                    <td><form:input path="name" /></td>
                    <td><form:errors path="name" cssClass="error" /></td>
                </tr>
                <tr>
                    <td>描述:</td>
                    <td><form:input path="description" /></td>
                    <td><form:errors path="description" cssClass="error" /></td>
                </tr>
                <tr>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr>
                <tr>
                    <td colspan="3">
                    <c:if test="${not empty category.id}">
                        <input type="submit" value="更新" />
                    </c:if>
                    <c:if test="${empty category.id}">
                        <input type="submit" value="提交" />
                    </c:if>
                    <a href="<c:url value="/admin/category/list?id=" />${category.parentId}">返回列表</a>
                    </td>
                </tr>
            
            </tbody>
            
        </table>
        </form:form>
    </body>
</html>



<script>
$(document).ready(function(){
    
});
</script>
